'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 十连抽
 * @author sundbcn@gmail.com (sun debing)
 */

var dataApi = require('../libs/dataApi');

exports.getEquipLotteryConf = function (job_type) {
    return _getEquipConf(job_type);
};

/**
 * 获取抽奖物品的品质
 *
 */
exports.getItemQuality = function (item_id) {
    var good_conf = dataApi.goods.findById(item_id);
    return good_conf.quality;
};

/**
 * 获取抽奖物品
 *
 */
exports.getRandomGood = function (item_id) {
    var good_conf = dataApi.goods_random.findById(item_id);
    return good_conf;
};

/**
 * 获取紫色装备
 *
 */
exports.getPurpleGood = function (job_type) {
    var good_conf = _getEquipConf(job_type);
    return this.getRandomGood(good_conf[2].goods_id);
};

var _getEquipConf = function (job_type) {
    return dataApi.equipment_lottery.findById(job_type);
};
